package com.cj;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;

/**
 * @author cc
 * @date 2024-08-20 10:34
 **/

public class CodeGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql:///ai-interview", "root", "root1234")
                .globalConfig(builder -> builder
                        .author("cc")
                        .outputDir("/Users/chenjie/code/ai-interview/ai-interview/ai-interview-main/src/main/java")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.cj.ai")
                        .entity("domain")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .addInclude("ai_interview_banner","ai_interview_category","ai_interview_category_item","ai_interview_records","ai_interview_models","wx_login")
                        .addTablePrefix("ai_interview_")
                        .entityBuilder()
                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
